/*
 * @Author: szx
 * @Date: 2022-03-23 15:20:43
 * @LastEditTime: 2022-03-23 15:23:46
 * @Description:
 * @FilePath: \leetcode\1-99\70\70.js
 */
/**
 * @param {number} n
 * @return {number}
 */
var climbStairs = function (n) {
    let dp1 = 0,
        dp2 = 1,
        res = 1;
    for (let i = 2; i <= n; i++) {
        res = dp1 + dp2;
        dp1 = dp2;
        dp2 = res;
    }
    return res;
};
